package cn.edu.dutir.corpus.trec;

import cn.edu.dutir.corpus.Topic;
import cn.edu.dutir.utility.Constants;

public class TrecDoc implements Topic {

	private String mDocno;
	private String mHeadline;
	private String mText;

	public TrecDoc(String docno, String hl, String text) {
		mDocno = docno;
		mHeadline = hl;
		mText = text;
	}

	public String docno() {
		return mDocno;
	}

	public String headline() {
		return mHeadline;
	}

	public String text() {
		return mText;
	}

	public void docno(String docno) {
		mDocno = docno;
	}

	public void headline(String hl) {
		mHeadline = hl;
	}

	public void text(String text) {
		mText = text;
	}

	public String toString() {
		StringBuffer sb = new StringBuffer();
		sb.append("<DOC>" + Constants.NEWLINE);
		sb.append("<DOCNO>" + mDocno + "</DOCNO>" + Constants.NEWLINE);
		sb.append("<HL>" + mHeadline + "</HL>" + Constants.NEWLINE);
		sb.append("<TEXT>" + Constants.NEWLINE);
		sb.append(mText + Constants.NEWLINE);
		sb.append("</TEXT>" + Constants.NEWLINE);
		sb.append("</DOC>" + Constants.NEWLINE);
		return sb.toString();
	}
}
